/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2018-05-29 09:22:36
 * @Copyright: 2018 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Lang;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.itttq.gshop.domain.po.ErpOrderPo;
import com.itttq.gshop.pbpm.cmpt.mybatis.CustomInLanguage;
import com.itttq.gshop.pbpm.provider.ErpOrderSqlProvider;

@Mapper
public interface IErpOrderMapper {
	/**
	 * 新增ErpOrderPo对象，并设置生成的ID到erpOrder对象中
	 * 
	 * @param ErpOrderPo
	 * @Author 迷蝶
	 * @return Integer
	 */
	@InsertProvider(type=ErpOrderSqlProvider.class,  method="addErpOrder") 
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public Integer addErpOrder(ErpOrderPo erpOrder);

	/**
	 * 更新ErpOrderPo对象
	 * 
	 * @param erpOrderPo
	 * @Author 迷蝶
	 * @return Integer
	 */
	@UpdateProvider(type=ErpOrderSqlProvider.class,  method="updateErpOrder") 
	public Integer updateErpOrder(ErpOrderPo erpOrder);
	
	/**
	 * 根据ID删除ErpOrderPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 * @return Integer
	 */
	@DeleteProvider(type=ErpOrderSqlProvider.class,  method="delErpOrder") 
	public Integer delErpOrderById(Integer id);

	/**
	 * 根据IDS删除ErpOrderPo对象
	 * 
	 * @param ids
	 * @Author 迷蝶
	 * @return List<ErpOrderPo>
	 */
	@Lang(CustomInLanguage.class)
	@Delete("DELETE FROM order_info WHERE id IN (#{ids})")
	public Integer delErpOrderByIds(@Param("ids") List<Integer> ids);
	
	/**
	 * 根据条件查找ErpOrderPo对象，默认根据ID降序
	 * 
	 * @param erpOrderPo
	 * @Author 迷蝶
	 * @return List<ErpOrderPo>
	 */
	@SelectProvider(type=ErpOrderSqlProvider.class,  method="findErpOrders") 
	public List<ErpOrderPo> findErpOrders(ErpOrderPo erpOrder);
	
	/**
	 * 根据条件查找记录总数
	 * 
	 * @param erpOrderPo
	 * @Author 迷蝶
	 * @return Integer
	 */
	@SelectProvider(type=ErpOrderSqlProvider.class,  method="findErpOrderCount") 
	public Integer findErpOrderCount(ErpOrderPo erpOrder);

	/**
	 * 根据ID查找ErpOrderPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 * @return ErpOrderPo
	 */
	@SelectProvider(type=ErpOrderSqlProvider.class,  method="findErpOrderById") 
	public ErpOrderPo findErpOrderById(Integer id);
	
}